<%-- 
    Document   : mainLayout
    Created on : 17.11.2013, 19:39:57
    Author     : palo
--%>

<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<s:layout-definition>
    <html>
        <head>
            <title><c:out value="${nadpis}" /></title>
            <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style.css" />
        </head>
        <body>
            <div id="cele">
                <h1><span></span><c:out value="${nadpis}" /></h1>
                <div id="lave_menu">
                    <shiro:hasRole name="ROLE_USER">



                        <div id="menu_login">
                            <h2><f:message key="login.menu"/></h2>
                            <ul>
                                <p><shiro:principal /></p>

                                <shiro:hasRole name="ROLE_REGISTERED">
                                    <li>                    
                                        <s:link beanclass="cz.muni.fi.pa165.mushroom.website.web.GathererActionBean" event="editGatherer">
                                            <f:message key="regLayout.editGatherer"/>
                                        </s:link>
                                    </li>
                                </shiro:hasRole>
                                <li><s:link href="/logout.jsp"><f:message key="regLayout.logout"/></s:link></li>

                                </ul>
                            </div>
                    </shiro:hasRole>
                    <div id="menu">
                        <h2>Menu</h2>
                        <ul>
                            <li><s:link href="/index.jsp"><f:message key="mainLayout.home"/></s:link></li>

                            <shiro:guest>
                                <li><s:link href="/login.jsp"><f:message key="mainLayout.login"/></s:link></li>
                                <li><s:link href="/register.jsp"><f:message key="mainLayout.register"/></s:link></li>
                                </shiro:guest>
                            <li><s:link href="/mushroomCatalog.jsp"><f:message key="mainLayout.catalog"/></s:link></li>
                            <li><s:link beanclass="cz.muni.fi.pa165.mushroom.website.web.VisitActionBean" event="showVisits"><f:message key="mainLayout.listVisits"/></s:link></li>

                                <li><s:link href="/listForests.jsp"><f:message key ="mainLayout.showForest"/></s:link></li>
                            <li><s:link href="/showGatherers.jsp"><f:message key ="mainLayout.showGatherers"/></s:link></li>
                                <shiro:hasRole name="ROLE_USER">


                                <shiro:hasRole name="ROLE_REGISTERED">

                                    <li><s:link href="/protected/showMyVisits.jsp"><f:message key="regLayout.showMyVisits"/></s:link></li>

                                </shiro:hasRole>
                            </shiro:hasRole>
                        </ul>
                    </div>
                </div>
                <div id="obsah">
                    <s:layout-component name="body"/>

                </div>
                <div id="spodok">

                    <p>
                        <f:message key="mainLayout.bottom"/>
                    </p>
                </div> 
        </body>
    </html>
</s:layout-definition>
